<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <title>绿格子</title>
  <!-- 高清方案脚本 -->
  <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
  <script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
  <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  <script>
    if(!window.Promise) {
      document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
    }
  </script>
  <link rel="stylesheet" href="./build/app.css">
</head>
<body>
  <div id="root" />
  <script src="./build/vendor.js"></script>
  <script src="./build/app.js"></script>
  <script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
  <script type="text/javascript">
    if ('addEventListener' in document) {
      window.addEventListener('load', function() {
        FastClick.attach(document.body);
      }, false);
    }
    $.ajax({
      type: 'GET',
      url: 'http://green.shundaonetwork.com/oauth/get-signature',
      dataType: 'json',
      data: { url: location.href.split('#')[0]},
      success: function(resData) {
        let data = resData.data
        wx.config({
          debug: true,
          appId: data.appId,
          timestamp: data.timestamp,
          nonceStr: data.nonceStr,
          signature: data.signature,
          jsApiList: ['hideMenuItems', 'onMenuShareTimeline', 'onMenuShareAppMessage']
        })
        wx.ready(function() {
          wx.onMenuShareAppMessage({
            title: '种植秀',
            type: 'link',
            link: 'http://green.shundaonetwork.com/oauth/wx_login',
            desc: '分享你的种植秀',
            imgUrl: 'http://green.shundaonetwork.com/icon.jpg',
            success: function() {
            },
            cancel: function() {
            },
          });
          wx.onMenuShareTimeline({
            title: '分享你的种植秀',
            type: 'link',
            link: 'http://green.shundaonetwork.com/oauth/wx_login',
            imgUrl: 'http://green.shundaonetwork.com/icon.jpg',
            success: function() {
            },
            cancel: function() {
            },
          });
        })
      }
    })
  </script>
</body>
</html>
